/*
 * @Description: 统计接口
 * @Author: Zzt
 * @Date: 2022-11-27 15:55:23
 * @LastEditTime: 2023-03-04 11:30:57
 */
import { IPageQuery } from '@/interfaces/global';
import { statRequest } from '@/utils/request';

/* 借阅利用次数统计 */
export interface IMoudleParams {
  authUnit?: any[];
  byear?: string;
  eyear?: string;
  operator?: any[];
  responsibleDept?: any[];
  sourceFormat?: any[];
  targetFormat?: any[];
  type?: number;
}
export function borrowTimes(data: IMoudleParams) {
  return statRequest({
    url: `/use-times/borrow-times/`,
    method: 'post',
    data
  });
}
/* 检索利用次数统计 */
export interface IRetrieveTimesParams {}
export function retrieveTimes(data: IRetrieveTimesParams) {
  return statRequest({
    url: `/use-times/retrieve-times/`,
    method: 'post',
    data
  });
}

/* 档案规范性检测次数统计 */
export interface IDetectionTimesParams {
  // archiveTypeIds: any[];
  // fileFormatList: any[];
}
export function detectionTimes(data: IDetectionTimesParams) {
  return statRequest({
    url: `/archive-detection/detection-times/`,
    method: 'post',
    data
  });
}
/* 档案移交次数统计 */
export interface ITransferTimesParams {
  // archiveTypeIds: any[];
  // fileFormatList: any[];
}
export function transferTimes(data: ITransferTimesParams) {
  return statRequest({
    url: `/archive-transfer-receive/transfer-times/`,
    method: 'post',
    data
  });
}
/* 档案接收次数统计 */
export interface IReceiveTimesParams {
  // archiveTypeIds: any[];
  // fileFormatList: any[];
}
export function receiveTimes(data: IReceiveTimesParams) {
  return statRequest({
    url: `/archive-transfer-receive/receive-times/`,
    method: 'post',
    data
  });
}
/* 档案移交统计柱状图 */
export function fromatForStat(data: IMoudleParams) {
  return statRequest({
    url: `/archiveFormatConver/fromatConverForStat/`,
    method: 'post',
    data
  });
}
export interface IReceiveAndTransferParams {
  archiveTypeIds?: any[];
  byear?: string;
  categorys?: any[];
  eyear?: string;
  fondsId?: number;
  fondsIds?: any[];
  formats?: any[];
  hondWay?: number;
  registrants?: any[];
  retentionPeriods?: any[];
  secrets?: any[];
  testPersons: any[];
  type?: number;
  units?: any[];
  year?: string;
}
/* 电子档案接收检查统计柱状图  */
export function acceptanceForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/archiveCheck/checkForStat/`,
    method: 'post',
    data
  });
}
export function acceptanceForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/archiveCheck/checkForTable/`,
    method: 'post',
    data
  });
}
/* 登记统计柱状图  */
export function registerForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/archiveToDb/toDbForStat/`,
    method: 'post',
    data
  });
}
export function registerForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/archiveToDb/toDbForTable/`,
    method: 'post',
    data
  });
}
/* 格式转换统计柱状图  */
export function formatForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/archiveFormatConver/fromatConverForStat/`,
    method: 'post',
    data
  });
}
export function formatForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/archiveFormatConver/fromatConverForTable/`,
    method: 'post',
    data
  });
}
/* 规范性检测统计柱状图  */
export function normativeForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/archive-detection/detectionForStat/`,
    method: 'post',
    data
  });
}
export function normativeForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/archive-detection/detectionForTable/`,
    method: 'post',
    data
  });
}

/* 检索利用统计柱状图  */
export function retrievalForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/use-times/retrieveForStat/`,
    method: 'post',
    data
  });
}
export function retrievalForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/use-times/retrieveForTable/`,
    method: 'post',
    data
  });
}
/* 电子借阅统计柱状图  */
export function eLendingForStat(data: IReceiveAndTransferParams) {
  return statRequest({
    url: `/use-times/borrowForStat/`,
    method: 'post',
    data
  });
}
export function eLendingForTable(data: IPageQuery<IReceiveAndTransferParams>) {
  return statRequest({
    url: `/use-times/borrowForTable/`,
    method: 'post',
    data
  });
}

/* 系统配置统计柱状图  */

export interface SystemParams {
  byear?: string;
  configType?: any[];
  eyear?: string;
  menuType?: number;
  optId?: any[];
  type?: number;
}

export function systemForStat(data: SystemParams) {
  return statRequest({
    url: `/statLogSysConfig/statForStatChart/`,
    method: 'post',
    data
  });
}
export function systemForTable(data: IPageQuery<SystemParams>) {
  return statRequest({
    url: `/statLogSysConfig/statForTable/`,
    method: 'post',
    data
  });
}
/* 系统备份与恢复  */
export function systemBakAndRecForStat(data: SystemParams) {
  return statRequest({
    url: `/statLogSysBakAndRec/statForStatChart/`,
    method: 'post',
    data
  });
}
export function systemBakAndRecForTable(data: IPageQuery<SystemParams>) {
  return statRequest({
    url: `/statLogSysBakAndRec/statForTable/`,
    method: 'post',
    data
  });
}
